package dao;

import org.springframework.jdbc.core.RowMapper;
import pojo.Account;

import java.sql.ResultSet;
import java.sql.SQLException;


public class AccountRowMapper implements RowMapper<Account> {
    @Override
    public Account mapRow(ResultSet resultSet, int i) throws SQLException {
        Account account = new Account();
        account.setId(resultSet.getInt("id"));
        account.setUsername(resultSet.getString("username"));
        account.setBalance(resultSet.getDouble("balance"));
        return account;
    }
}
